package com.bzxhh.spring6.iocxml.bean;

import com.bzxhh.spring6.iocxml.bean.UserDao;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestUserDao {

    public static void main(String[] args) {

        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");

//        UserDao userDao = context.getBean(UserDao.class);
//        System.out.println(userDao);
//        userDao.run();

        UserDao userDaoImpl = context.getBean("userDaoImpl", UserDao.class);
        System.out.println(userDaoImpl);
        userDaoImpl.run();

        UserDao personDaoImpl = context.getBean("personDaoImpl", PersonDaoImpl.class);
        System.out.println(personDaoImpl);
        personDaoImpl.run();
    }
}
